home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Utilities / vim-5.1 / doc / vi_diff.txt < prev    next >
Encoding:
Text File  |  1998-04-05  |  32.1 KB  |  779 lines

  1. *vi_diff.txt*   For Vim version 5.1.  Last modification: 1998 Jan 25
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Differences from Vi and Ex                *vi-differences*
  8.  
  9. Throughout the help files differences between Vim and Vi/Ex are given in
  10. curly braces.  This file only lists what has not been mentioned in
  11. other files and gives an overview.
  12.  
  13. 1. Missing commands            |missing-commands|
  14. 2. Missing options            |missing-options|
  15. 3. Limits                |limits|
  16. 4. The most interesting additions    |vim-additions|
  17. 5. Other vim features            |other-features|
  18. 6. Command line arguments        |cmdline-arguments|
  19.  
  20. ==============================================================================
  21. 1. Missing commands                    *missing-commands*
  22.  
  23. This command is in Vi, but not in Vim:
  24.  
  25. :o[pen]            {Vi: start editing in open mode} *:o* *:open*
  26.  
  27. ==============================================================================
  28. 2. Missing options                    *missing-options*
  29.  
  30. These options are in the Unix Vi, but not in Vim.  If you try to set one of
  31. them you won't get an error message, but the value is not used and cannot be
  32. printed.
  33.  
  34. autoprint (ap)        toggle    (default on)        *'autoprint'* *'ap'*
  35. beautify (bf)        toggle    (default off)        *'beautify'* *'bf'*
  36. flash (fl)        toggle    (default ??)        *'flash'* *'fl'*
  37. graphic (gr)        toggle    (default off)        *'graphic'* *'gr'*
  38. hardtabs (ht)        number    (default 8)        *'hardtabs'* *'ht'*
  39.     number of spaces that a <Tab> moves on the display
  40. mesg            toggle    (default on)        *'mesg'*
  41. novice            toggle    (default ??)        *'novice'*
  42. open            toggle    (default on)        *'open'*
  43. optimize (op)        toggle    (default off)        *'optimize'* *'op'*
  44. prompt            toggle    (default on)        *'prompt'*
  45. redraw            toggle    (default off)        *'redraw'*
  46. slowopen (slow)        toggle    (default off)        *'slowopen'* *'slow'*
  47. sourceany        toggle    (default off)        *'sourceany'*
  48. tagstack (tgst)        toggle  (default on)        *'tagstack'* *'tgst'*
  49.     enables the tagstack and ":pop".
  50. window (wi)        number    (default 23)        *'window'* *'wi'*
  51. w300            number    (default 23)        *'w300'*
  52. w1200            number    (default 23)        *'w1200'*
  53. w9600            number    (default 23)        *'w9600'*
  54.  
  55. ==============================================================================
  56. 3. Limits                        *limits*
  57.  
  58. Vim has only a few limits for the files that can be edited {Vi: can not handle
  59. <Nul> characters and characters above 128, has limited line length, many other
  60. limits}.
  61.  
  62. Maximum line length       On machines with 16-bit ints (Amiga and MS-DOS real
  63.                mode): 32767, otherwise 2147483647 characters.
  64.                Longer lines are split.
  65. Maximum number of lines       2147483647 lines.
  66. Maximum file size       Only limited by available disk space for the swap
  67.                file.
  68. Length of a file name       Unix and Win32: 1024 characters, otherwise 256
  69.                characters.
  70. Length of an expanded string option
  71.                Unix and Win32: 1024 characters, otherwise 256
  72.                characters
  73. Maximum display width       Unix and Win32: 1024 characters, otherwise 255
  74.                characters
  75. Maximum lhs of a mapping   50 characters.
  76.  
  77. Information for undo and registers are kept in memory, thus when making (big)
  78. changes the amount of (virtual) memory available limits the number of undo
  79. levels and the text that can be kept in registers.  Other things are also kept
  80. in memory:  Command line history, error messages for Quickfix mode, etc.
  81. This is a summary of the differences between VIM and vi. It is not complete.
  82. Look in the other documentation files for comments in {}, like "{not in Vi}".
  83.  
  84. Vim is mostly POSIX 1003.2-1 compliant.  The only command known to be missing
  85. is ":open".  There are probably a lot of small differences.
  86.  
  87. Memory usage limits
  88. -------------------
  89.  
  90. The option 'maxmem' ('mm') is used to set the maximum memory used for one
  91. buffer (in kilobytes).  'maxmemtot' is used to set the maximum memory used for
  92. all buffers (in kilobytes).  The defaults depend on the system used.  For the
  93. Amiga and MS-DOS, 'maxmemtot' is set depending on the amount of memory
  94. available.  If you don't like Vim to swap to a file, set 'maxmem' and
  95. 'maxmemtot' to a very large value.  The swap file will then only be used for
  96. recovery.  If you don't want a swap file at all, set 'updatecount' to 0, or
  97. use the "-n" argument when starting Vim.  Note that the 'maxmem' option is
  98. only used when a buffer is created.  Changing this option does not affect
  99. buffers that have already been loaded.  Thus you can set it to different
  100. values for different files.  'maxmemtot' works always.
  101.  
  102. ==============================================================================
  103. 4. The most interesting additions            *vim-additions*
  104.  
  105. Vi compatibility.                    |'compatible'|
  106.     Although Vim is 99% Vi compatible, some things in Vi can be
  107.     considered to be a bug, or at least need improvement.  But still, Vim
  108.     starts in a mode which behaves like the "real" Vi as much as possible.
  109.     To make Vim behave a little bit better, try resetting the 'compatible'
  110.     option:
  111.         :set nocompatible
  112.     Or start Vim with the "-N" argument:
  113.         vim -N
  114.     This is done automatically if you have a .vimrc file.  See |startup|.
  115.     The 'cpoptions' option can be used to set Vi compatibility on/off for
  116.     a number of specific items.             |'cpoptions'|
  117.  
  118. Support for different systems.
  119.     Vim can be used on:
  120.     - All Unix systems (it works on all systems it was tested on, although
  121.       the GUI and Perl interface may not work everywhere).
  122.     - Amiga (500, 1000, 1200, 2000, 3000, 4000, ...).
  123.     - MS-DOS in real-mode (no additional drivers required).
  124.     - In protected mode on Windows 3.1 and MS-DOS (DPMI driver required).
  125.     - Windows 95 and Windows NT, with support for long file names.
  126.     - OS/2 (needs emx.dll)
  127.     - Atari MiNT
  128.     - VMS
  129.     - BeOS
  130.     - Macintosh (although there is no binary available, needs some work)
  131.  
  132. Multi level undo.                    |undo|
  133.     'u' goes backward in time, 'ctrl-R' goes forward again.  Set option
  134.     'undolevels' to the number of changes to be remembered (default 1000).
  135.     Set 'undolevels' to 0 for a vi-compatible one level undo. Set it to
  136.     -1 for no undo at all.
  137.  
  138.     When all changes in a buffer have been undone, the buffer is not
  139.     considered changed anymore.  You can exit it with :q, without <!>.
  140.  
  141. Graphical User Interface (GUI)                |gui|
  142.     Included support for GUI: menu's, mouse, scrollbars, etc.  You can
  143.     define your own menus.  Better support for CTRL/SHIFT/ALT keys in
  144.     combination with special keys and mouse.  Currently for X11 (with
  145.     Motif and Athena interfaces) and Win32 (Windows 95 and Windows NT).
  146.  
  147. Multiple windows and buffers.                |windows.txt|
  148.     Vim can split the screen into several windows, each editing a
  149.     different buffer or the same buffer at a different location.  Buffers
  150.     can still be loaded (and changed) but not displayed in a window.  This
  151.     is called a hidden buffer.  Many commands and options have been added
  152.     for this facility.
  153.  
  154. Syntax highlighting.                    |:syntax|
  155.     Vim can highlight keywords, patterns and other things.  This is
  156.     defined by a number of ":syntax" commands, and can be made to
  157.     highlight most languages and file types.  A number of files are
  158.     included for highlighting the most common languages, like C, C++,
  159.     Java, Pascal, Makefiles, shell scripts, etc.  The colors used for
  160.     highlighting can be defined for ordinary terminals, color terminals
  161.     and the GUI with the ":highlight" command.
  162.  
  163. Repeat a series of commands.                |q|
  164.     'q'<c> starts recording typed characters into named register <c>
  165.     (append to the register if register name is upper case).  A subsequent
  166.     'q' stops recording.  The register can then be executed with the
  167.     '@'<c> command.  This is very useful to repeat a complex action.
  168.  
  169. Flexible insert mode.                    |ins-special-special|
  170.     The arrow keys can be used in insert mode to move around in the file.
  171.     This breaks the insert in two parts as far as undo and redo is
  172.     concerned.
  173.  
  174.     CTRL-O can be used to execute a single command-mode command.  This is
  175.     almost the same as hitting <Esc>, typing the command and hitting 'a'.
  176.  
  177. Visual mode.                        |Visual-mode|
  178.     Visual can be used to first highlight a piece of text and then give a
  179.     command to do something with it.  This is an (easy to use) alternative
  180.     to first giving the operator and then moving to the end of the text
  181.     to be operated upon.  'v' and 'V' are used to start Visual mode.  'v'
  182.     works on characters and 'V' on lines.  Move the cursor to extend the
  183.     Visual part.  It is shown highlighted on the screen.  By typing 'o'
  184.     the other end of the Visual text can be moved.  The Visual text can
  185.     be affected by an operator:
  186.         d    delete
  187.         c    change
  188.         y    yank
  189.         > or <    insert or delete indent
  190.         !    filter through external program
  191.         =    filter through indent
  192.         :    start ":" command for the Visual lines.
  193.         gq    format text to 'textwidth' columns
  194.         J    join lines
  195.         ~    swap case
  196.         u    make lowercase
  197.         U    make uppercase
  198.  
  199. Block operators.                    |visual-block|
  200.     With Visual a rectangular block of text can be selected.  Start Visual
  201.     with CTRL-V.  The block can be deleted ('d'), yanked ('y') or its case
  202.     can be changed ('~', 'u' and 'U').  A deleted or yanked block can be
  203.     put into the text with the 'p' and 'P' commands.
  204.  
  205. Online help system.                    |:help|
  206.     Help is displayed in a window.  The usual commands can be used to
  207.     move around, search for a string, etc.  Tags can be used to jump
  208.     around in the help files, just like hypertext links.  The ":help"
  209.     command takes an argument to quickly jump to the info on a subject.
  210.     <F1> is the quick access to the help system.  The name of the help
  211.     index file can be set with the 'helpfile' option.
  212.  
  213. Command-line editing and history.            |cmdline-editing|
  214.     You can insert or delete at any place in the command-line using the
  215.     cursor keys.  The right/left cursor keys can be used to move
  216.     forward/backward one character.  The shifted right/left cursor keys
  217.     can be used to move forward/backward one word.  CTRL-B/CTRL-E can be
  218.     used to go to the begin/end of the command-line.
  219.  
  220.                             |cmdline-history|
  221.     The command-lines are remembered.  The up/down cursor keys can be used
  222.     to recall previous command-lines.  The 'history' option can be set to
  223.     the number of lines that will be remembered.  There is a separate
  224.     history for commands and for search patterns.
  225.  
  226. Command-line completion.                |cmdline-completion|
  227.     While entering a command-line (on the bottom line of the screen)
  228.     <Tab> can be typed to complete
  229.        what        example        ~
  230.     - command    :e<Tab>
  231.     - tag        :ta scr<Tab>
  232.     - option    :set sc<Tab>
  233.     - option value  :set hf=<Tab>
  234.     - file name    :e ve<Tab>
  235.     - etc.
  236.  
  237.     If there are multiple matches, CTRL-N (next) and CTRL-P (previous)
  238.     will walk through the matches.  <Tab> works like CTRL-N, but wraps
  239.     around to the first match.
  240.  
  241.     The 'wildchar' option can be set to the character for command-line
  242.     completion, <Tab> is the default.  CTRL-D can be typed after an
  243.     (incomplete) wildcard; all matches will be listed.  CTRL-A will insert
  244.     all matches.  CTRL-L will insert the longest common part of the
  245.     matches.
  246.  
  247. Insert-mode completion                    |ins-completion|
  248.     In insert mode the CTRL-N and CTRL-P keys can be used to complete a
  249.     word that has previously been used.    |i_CTRL-N|
  250.     With CTRL-X another mode is entered, through wich completion can be
  251.     done for:
  252.     |i_CTRL-X_CTRL-F|    file names
  253.     |i_CTRL-X_CTRL-K|    words from a dictionary
  254.     |i_CTRL-X_CTRL-I|    words from included files
  255.     |i_CTRL-X_CTRL-L|    whole lines
  256.     |i_CTRL-X_CTRL-]|    words from the tags file
  257.     |i_CTRL-X_CTRL-D|    definitions or macros
  258.  
  259. Long line support                    |'wrap'| |'linebreak'|
  260.     If the 'wrap' option is off, long lines will not wrap and only part
  261.     of them will be shown.  When the cursor is moved to a part that is not
  262.     shown, the screen will scroll horizontally.  The minimum number of
  263.     columns to scroll can be set with the 'sidescroll' option.  The "zh"
  264.     and "zl" commands can be used to scroll sideways.
  265.     Alternatively, long lines are broken in between words when the
  266.     'linebreak' option is set.  This allows editing a single-line
  267.     paragraph conveniently (e.g. when the text is later read into a DTP
  268.     program).  Move the cursor up/down with the "gk" and "gj" commands.
  269.  
  270. Text formatting.                    |formatting|
  271.     The 'textwidth' option can be used to automatically limit the line
  272.     length.  This supplements the 'wrapmargin' option of Vi, which was not
  273.     very useful.  The "gq" operator can be used to format a piece of text
  274.     (for example, "gqap" formats the current paragraph).  Commands for
  275.     text alignment: ":center", ":left" and ":right".
  276.  
  277. Edit-compile-edit speedup.                |quickfix|
  278.     The ":make" command can be used to run the compilation and jump to
  279.     the first error.  Alternatively Vim can be started with the "-q"
  280.     option from the compiler.  A file with compiler error messages is
  281.     interpreted.  Vim starts editing at the first error.
  282.  
  283.     Each line in the error file is scanned for the name of a file, line
  284.     number and error message.  The 'errorformat' option can be set to a
  285.     list of scanf-like strings to handle output from many compilers.
  286.  
  287.     The ":cn" command can be used to jump to the next error.
  288.     ":cl" lists all the error messages.  Other commands are available
  289.     (almost the same as with Manx's Z editor on the Amiga).
  290.     The 'makeef' option has the name of the file with error messages.
  291.     The 'makeprg' option contains the name of the program to be executed
  292.     with the ":make" command.
  293.     The 'shellpipe' option contains the string to be used to put the
  294.     output of the compiler into the errorfile.
  295.  
  296. Improved indenting for C programs            |'cindent'|
  297.     When the 'cindent' option is on the indent of each line is
  298.     automatically adjusted.  C syntax is mostly recognized.  The indent
  299.     for various styles can be set with 'cinoptions'.  The keys to trigger
  300.     indenting can be set with 'cinkeys'.
  301.  
  302.     Comments can be automatically formatted.  The 'comments' option can be
  303.     set to the characters that start and end a comment.  This works best
  304.     for C code, but also works for e-mail (">" at start of the line) and
  305.     other types of text.  The "=" operator can be used to re-indent
  306.     lines.
  307.  
  308. Searching for words in include files            |include-search|
  309.     The "[i" command can be used to search for a match of the word under
  310.     the cursor in the current and included files.  The 'include' option
  311.     can be set the a pattern that describes a command to include a file
  312.     (the default is for C programs).
  313.     The "[I" command lists all matches, the "[ CTRL-I" command jumps to
  314.     a match.
  315.     The "[d", "[D" and "[ CTRL-D" commands do the same, but only for
  316.     lines where the pattern given with the 'define' option matches.
  317.  
  318. Automatic commands                    |autocommand|
  319.     Commands can be automatically executed when reading a file, writing a
  320.     file, jumping to another buffer, etc., depending on the file name.
  321.     This is useful to set options and mappings for C programs,
  322.     documentation, plain text, e-mail, etc.  This also makes it possible
  323.     to edit compressed files.
  324.  
  325. Scripts and Expressions                    |expression|
  326.     Commands have been added to form up a simple but powerful script
  327.     language.
  328.     |:if|        Conditional execution, which can be used for example
  329.             to set options depending on the value of $TERM.
  330.     |:while|    Repeat a number of commands.
  331.     |:echo|        Print the result of an expression.
  332.     |:let|        Assign a value to an internal variable, option, etc.
  333.     |:execute|    Execute a command formed by an expression.
  334.     etc.
  335.  
  336. Viminfo                            |viminfo-file|
  337.     The command-line history, marks and registers can be stored in a file
  338.     that is read on startup.  This can be used to repeat a search command
  339.     or command-line command after exiting and restarting Vim.  It is also
  340.     possible to jump right back to where the last edit stopped with "'0".
  341.     The 'viminfo' option can be set to select which items to store in the
  342.     .viminfo file.  This is off by default.
  343.  
  344. Mouse support                        |mouse-using|
  345.     The mouse is supported in the GUI version, in an xterm for Unix, for
  346.     MS-DOS, and Win32.  It can be used to position the cursor, select the
  347.     visual area, paste a register, etc.
  348.  
  349. Usage of key names                    |<>| |key-notation|
  350.     Special keys now all have a name like <Up>, <End>, etc.
  351.     This name can be used in mappings, to make it easy to edit them.
  352.  
  353. Editing binary files                    |edit-binary|
  354.     Vim can edit binary files.  You can change a few characters in an
  355.     executable file, whithout corrupting it.  Vim doesn't remove NUL
  356.     characters (they are represented as <NL> internally).
  357.     |-b|        command line argument to start editing a binary file
  358.     |'binary'|    Option set by "-b".  Prevents adding an <EOL> for the
  359.             last line in the file.
  360.  
  361. ==============================================================================
  362. 5. Other vim features                    *other-features*
  363.  
  364. A random collection of nice extra features.
  365.  
  366.  
  367. When Vim is started with "-s scriptfile", the characters read from
  368. "scriptfile" are treated as if you typed them.  If end of file is reached
  369. before the editor exits, further characters are read from the console.
  370.  
  371. The "-w" option can be used to record all typed characters in a script file.
  372. This file can then be used to redo the editing, possibly on another file or
  373. after changing some commands in the script file.
  374.  
  375. The "-o" option opens a window for each argument.  "-o4" opens four windows.
  376.  
  377.  
  378. In command mode:
  379.  
  380. When the 'showcmd' option is set, the command characters are shown in the last
  381. line of the screen.  They are removed when the command is finished.
  382.  
  383. If the 'ruler' option is set, the current cursor position is shown in the
  384. last line of the screen.
  385.  
  386. 'U' still works after having moved off the last changed line and after 'u'.
  387.  
  388. Characters with the 8th bit set are displayed.  The characters between '~' and
  389. 0xa0 are displayed as "~?", "~@", "~A", etc., unless the "graphic' option is
  390. set.
  391.  
  392. '][' goes to the next ending of a C function ('}' in column 1).
  393. '[]' goes to the previous ending of a C function ('}' in column 1).
  394.  
  395. ']f', '[f' and 'gf' start editing the file whose name is under the cursor.
  396. CTRL-W f splits the window and starts editing the file whose name is under
  397. the cursor.
  398.  
  399. '*' searches forward for the identifier under the cursor, '#' backward.
  400. 'K' runs the program defined by the "keywordprg" option, with the identifier
  401. under the cursor as argument.
  402.  
  403. '%' can be preceded with a count.  The cursor jumps to the line that
  404. percentage down in the file.  The normal '%' function to jump to the matching
  405. brace skips braces inside quotes.
  406.  
  407. With the CTRL-] command, the cursor may be in the middle of the identifier.
  408.  
  409. The used tags are remembered.  Commands that can be used with the tag stack
  410. are CTRL-T, ':pop' and ':tag'.  ':tags' lists the tag stack.
  411.  
  412. The 'tags' option can be set to a list of tag file names.  Thus multiple
  413. tag files can be used.  For file names that start with '.', the '.' is
  414. replaced with the path of the current file.  This makes it possible to use a
  415. tags file in the same directory as the file being edited.
  416.  
  417. Previously used file names are remembered in the alternate file name list.
  418. CTRL-^ accepts a count, which is an index in this list.
  419.  
  420. Search patterns have more features.  The <NL> character is seen as part of the
  421. search pattern and the substitute string of ":s".  Vi sees it as the end of
  422. the command.
  423.  
  424. Searches can put the cursor on the end of a match and may include a character
  425. offset.
  426.  
  427. Count added to '~', ':next', ':Next', 'n' and 'N'.
  428.  
  429. The command ":next!" with 'autowrite' set does not write the file.  In vi the
  430. file was written, but this is considered to be a bug, because one does not
  431. expect it and the file is not written with ':rewind!'.
  432.  
  433. In Vi when entering a <CR> in replace mode deletes a character only when 'ai'
  434. is set (but does not show it until you hit <Esc>).  Vim always deletes a
  435. character (and shows it immediately).
  436.  
  437. Added :wnext command.  Same as ":write" followed by ":next".
  438.  
  439. The ":w!" command always writes, also when the file is write protected.  In Vi
  440. you would have to do ":!chmod +w %" and ":set noro".
  441.  
  442. When 'tildeop' has been set, '~' is an operator (must be followed by a
  443. movement command).
  444.  
  445. With the 'J' (join) command you can reset the 'joinspaces' (js) option to
  446. have only one space after a period (Vi inserts two spaces).
  447.  
  448. 'cw' can be used to change white space formed by several characters (Vi is
  449. confusing: 'cw' only changes one space, while 'dw' deletes all white space).
  450.  
  451. 'o' and 'O' accept a count for repeating the insert (Vi clears a part of
  452. display).
  453.  
  454. Previously used file names are remembered in the alternate file name list.
  455. ":files" command shows the list of alternate file names.
  456. '#'<N> is replaced with the <N>th alternate file name in the list.
  457. "#<" is replaced with the current file name without extension.
  458.  
  459. Flags after Ex commands not supported (no plans to include it).
  460.  
  461. On non-UNIX systems ":cd" command shows current directory instead of going to
  462. the home directory (there isn't one).  ":pwd" prints the current directory on
  463. all systems.
  464.  
  465. ':source!' command reads Vi commands from a file.
  466.  
  467. ':mkexrc' command writes current modified options and mappings to a ".exrc"
  468. file.  ':mkvimrc' writes to a ".vimrc" file.
  469.  
  470. No check for "tail recursion" with mappings.  This allows things like
  471. ":map! foo ^]foo".
  472.  
  473. When a mapping starts with number, vi loses the count typed before it (e.g.
  474. when using the mapping ":map g 4G" the command "7g" goes to line 4).  This is
  475. considered a vi bug.  Vim concatenates the counts (in the example it becomes
  476. "74G"), as most people would expect.
  477.  
  478. The :put! command inserts the contents of a register above the current line.
  479.  
  480. The 'p' and 'P' commands of vi cannot be repeated with '.' when the putted
  481. text is less than a line.  In Vim they can always be repeated.
  482.  
  483. ":noremap" command can be used to enter a mapping that will not be remapped.
  484. This is useful to exchange the meaning of two keys.  ":cmap", ":cunmap" and
  485. ":cnoremap" can be used for mapping in command-line editing only.  ":imap",
  486. ":iunmap" and ":inoremap" can be used for mapping in insert mode only.
  487. Similar commands exist for abbreviations: ":noreabbrev", ":iabbrev"
  488. ":cabbrev", ":iunabbrev", ":cunabbrev", ":inoreabbrev", ":cnoreabbrev".
  489.  
  490. In Vi the command ":map foo bar" would remove a previous mapping
  491. ":map bug foo".  This is considered a bug, so it is not included in Vim.
  492. ":unmap! foo" does remove ":map! bug foo", because unmapping would be very
  493. difficult otherwise (this is vi compatible).
  494.  
  495. The ':' register contains the last command-line.
  496. The '%' register contains the current file name.
  497. The '.' register contains the last inserted text.
  498.  
  499. ':dis' command shows the contents of the yank registers.
  500.  
  501. CTRL-O/CTRL-I can be used to jump to older/newer positions.  These are the
  502. same positions as used with the '' command, but may be in another file.  The
  503. ':jumps' command lists the older positions.
  504.  
  505. If the 'shiftround' option is set, an indent is rounded to a multiple of
  506. 'shiftwidth' with '>' and '<' commands.
  507.  
  508. The 'scrolljump' option can be set to the minimum number of lines to scroll
  509. when the cursor gets off the screen.  Use this when scrolling is slow.
  510.  
  511. The 'scrolloff' option can be set to the minimum number of lines to keep
  512. above and below the cursor.  This gives some context to where you are
  513. editing.  When set to a large number the cursor line is always in the middle
  514. of the window.
  515.  
  516. Uppercase marks can be used to jump between files.  The ':marks' command lists
  517. all currently set marks.  The commands "']" and "`]" jump to the end of the
  518. previous operator or end of the text inserted with the put command.  "'[" and
  519. "`[" do jump to the start.
  520.  
  521. The 'shelltype' option can be set to reflect the type of shell used on the
  522. Amiga.
  523.  
  524. The 'highlight' option can be set for the higlight mode to be used for
  525. several commands.
  526.  
  527. The CTRL-A (add) and CTRL-X (subtract) commands are new.  The count to the
  528. command (default 1) is added to/subtracted from the number at or after the
  529. cursor.  That number may be decimal, octal (starts with a '0') or hexadecimal
  530. (starts with '0x').  Very useful in macros.
  531.  
  532. With the :set command the prefix "inv" can be used to invert toggle options.
  533.  
  534. In both Vi and Vim you can create a line break with the ":substitute" command
  535. by using a CTRL-M.  For Vi this means you cannot insert a real CTRL-M in the
  536. text.  With Vim you can put a real CTRL-M in the text by preceding it with a
  537. CTRL-V.
  538.  
  539.  
  540. In Insert mode:
  541.  
  542. If the 'revins' option is set, insert happens backwards.  This is for typing
  543. Hebrew.  When inserting normal characters the cursor will not be shifted and
  544. the text moves rightwards.  Backspace, CTRL-W and CTRL-U will also work in
  545. the opposite direction.  CTRL-B toggles the 'revins' option.  In replace mode
  546. 'revins' has no effect.  Only when enabled at compile time.
  547.  
  548. The backspace key can be used just like CTRL-D to remove auto-indents.
  549.  
  550. You can backspace, ctrl-U and CTRL-W over line breaks if the 'backspace' (bs)
  551. option is set to non-zero.  You can backspace over the start of insert if the
  552. 'backspace' option is set to 2.
  553.  
  554. When the 'paste' option is set, a few option are reset and mapping in insert
  555. mode and abbreviation are disabled.  This allows for pasting text in windowing
  556. systems without unexpected results.  When the 'paste' option is reset, the old
  557. option values are restored.
  558.  
  559. CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter
  560. what column the cursor is in.
  561.  
  562. CTRL-@ (insert previously inserted text) works always (Vi: only when typed as
  563. first character).
  564.  
  565. CTRL-A works like CTRL-@ but does not leave insert mode.
  566.  
  567. CTRL-R <0-9a-z..> can be used to insert the contents of a register.
  568.  
  569. When the 'smartindent' option is set, C programs will be better auto-indented.
  570. With 'cindent' even more.
  571.  
  572. CTRL-Y and CTRL-E can be used to copy a character from above/below the
  573. current cursor position.
  574.  
  575. After CTRL-V you can enter a three digit decimal number.  This byte value is
  576. inserted in the text as a single character.  Useful for international
  577. characters that are not on your keyboard.
  578.  
  579. When the 'expandtab' (et) option is set, a <Tab> is expanded to the
  580. appropriate number of spaces.
  581.  
  582. The window always reflects the contents of the buffer (Vi does not do this
  583. when changing text and in some other cases).
  584.  
  585. If Vim is compiled with DIGRAPHS defined, digraphs are supported.  A set of
  586. normal digraphs is included.  They are shown with the ":digraph" command.
  587. More can be added with ":digraph {char1}{char2} {number}".  A digraph is
  588. entered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when
  589. 'digraph' option is set).
  590.  
  591. When repeating an insert, e.g. "10atest <Esc>" vi would only handle wrapmargin
  592. for the first insert.  Vim does it for all.
  593.  
  594. A count to the 'i' or 'a' command is used for all the text.  Vi uses the count
  595. only for one line.  "3iabc<NL>def<Esc>" would insert "abcabcacc<NL>def" in Vi
  596. but "abc<NL>defabc<NL>defabc<NL>def" in Vim.
  597.  
  598.  
  599. In Command-line mode:
  600.  
  601. <Esc> terminates the command-line without executing it. In vi the command
  602. line would be executed, which is not what most people expect (hitting <Esc>
  603. should always get you back to command mode).  To avoid problems with some
  604. obscure macros, an <Esc> in a macro will execute the command.  If you want a
  605. typed <Esc> to execute the command like vi does you can fix this with
  606.     ":cmap ^V<Esc> ^V<CR>"
  607.  
  608. General:
  609.  
  610. The 'ttimeout' option is like 'timeout', but only works for cursor and
  611. function keys, not for ordinary mapped characters.  The 'timeoutlen' option
  612. gives the number of milliseconds that is waited for.  If the 'esckeys' option
  613. is not set, cursor and function keys that start with <Esc> are not recognized
  614. in insert mode.
  615.  
  616. There is an option for each terminal string.  Can be used when termcap is not
  617. supported or to change individual strings.
  618.  
  619. The 'fileformat' option can be set to select the <EOL>: "dos" <CR><NL>, "unix"
  620. <NL> or "mac" <CR>.
  621. When the 'fileformats' option is not empty, Vim tries to detect the type of
  622. <EOL> automatically.  The 'fileformat' option is set accordingly.
  623.  
  624. On systems that have no job control (older Unix systems and non-Unix systems)
  625. the CTRL-Z, ":stop" or ":suspend" command starts a new shell.
  626.  
  627. If Vim is started on the Amiga without an interactive window for output, a
  628. window is opened (and :sh still works).  You can give a device to use for
  629. editing with the '-d' argument, e.g. "-d con:20/20/600/150".
  630.  
  631. The 'columns' and 'lines' options are used to set or get the width and height
  632. of the display.
  633.  
  634. Option settings are read from the first and last few lines of the file.
  635. Option 'modelines' determines how many lines are tried (default is 5).  Note
  636. that this is different from the Vi versions that can execute any Ex command
  637. in a modeline (a major security problem).  |trojan-horse|
  638.  
  639. If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
  640. And it comes back there, when pressing <Esc>.
  641.  
  642. Undo information is kept in memory.  Available memory limits the number and
  643. size of change that can be undone.  This may be a problem with MS-DOS, is
  644. hardly a problem on the Amiga and almost never with Unix and Win32.
  645.  
  646. If the 'backup' or 'writebackup' option is set: Before a file is overwritten,
  647. a backup file (.bak) is made.  If the "backup" option is set it is left
  648. behind.
  649.  
  650. Vim creates a file ending in ".swp" to store parts of the file that have been
  651. changed or that do not fit in memory.  This file can be used to recover from
  652. an aborted editing session with "vim -r file".  Using the swap file can be
  653. switched off by setting the 'updatecount' option to 0 or starting Vim with
  654. the "-n" option.  Use the 'directory' option for placing the .swp file
  655. somewhere else.
  656.  
  657. Vim is able to work correctly on filesystems with 8.3 file names, also when
  658. using messydos or crossdos filesystems on the Amiga, or any 8.3 mounted
  659. filesystem under Unix.  See |'shortname'|.
  660.  
  661. Error messages are shown at least one second (Vi overwrites error messages).
  662.  
  663. If Vim gives the |hit-return| prompt, you can hit any key.  Characters other
  664. than <CR>, <NL> and <Space> are interpreted as the (start of) a command.  (Vi
  665. only accepts a command starting with ':').
  666.  
  667. The contents of the numbered and unnamed registers is remembered when
  668. changing files.
  669.  
  670. The "No lines in buffer" message is a normal message instead of an error
  671. message, since that may cause a mapping to be aborted.
  672.  
  673. The AUX: device of the Amiga is supported.
  674.  
  675. ==============================================================================
  676. 6. Command line arguments                *cmdline-arguments*
  677.  
  678. Different versions of Vi have different command line arguments.  This can be
  679. confusing.  To help you, this section gives an overview of the differences.
  680.  
  681. Five versions of Vi will be considered here:
  682.     Elvis    Elvis version 2.1b
  683.     Nvi    Nvi version 1.79
  684.     Posix    Posix 1003.2
  685.     Vi    Vi version 3.7 (for Sun 4.1.x)
  686.     Vim    Vim version 5.0
  687.  
  688. Only Vim is able accept options after the file names.
  689.  
  690. +{command}    Elvis, Nvi, Posix, Vi, Vim: Same as "-c {command}".
  691.  
  692. -        Nvi, Posix, Vi: Run Ex in batch mode.
  693.         Vim: Read file from stdin (use -s for batch mode).
  694.  
  695. --        Vim: End of options, only file names are following.
  696.  
  697. -a        Elvis: Load all specified file names into a window (use -o for
  698.         Vim).
  699.  
  700. -b {blksize}    Elvis: Use {blksize} blocksize for the session file.
  701. -b        Vim: set 'binary' mode.
  702.  
  703. -C        Vim: Compatible mode.
  704.  
  705. -c {command}    Elvis, Nvi, Posix, Vim: run {command} as an Ex command after
  706.         loading the edit buffer.
  707.         Vim: allow up to 10 commands.
  708.  
  709. -d {device}    Vim: Use {device} for I/O (Amiga only).
  710.  
  711. -e        Elvis, Nvi, Vim: Start in Ex mode, as if the executable is
  712.         called "ex".
  713.  
  714. -f        Nvi: Don't copy the whole file when editing starts.
  715.         Vim: Run GUI in foreground (Amiga: don't open new window).
  716. -f {session}    Elvis: Use {session} as the session file.
  717.  
  718. -F        Vim: Start in Farsi mode (when compiled with Farsi).
  719.  
  720. -G {gui}    Elvis: Use the {gui} as user interface.
  721.  
  722. -g        Vim: Start GUI.
  723.  
  724. -h        Vim: Give help message.
  725.  
  726. -H        Vim: start Hebrew mode (when compiled with it).
  727.  
  728. -i        Elvis: Start each window in Insert mode.
  729. -i {viminfo}    Vim: Use {viminfo} for viminfo file.
  730.  
  731. -L        Vim: Same as "-r" (also in some versions of Vi).
  732.  
  733. -l        Nvi, Vi, Vim: Set 'lisp' and 'showmatch' options.
  734.  
  735. -N        Vim: No-compatible mode.
  736.  
  737. -n        Vim: No swap file used.
  738.  
  739. -o[N]        Vim: Open [N] windows, or one for each file.
  740.  
  741. -q {name}    Vim: Use {name} for quickfix error file.
  742. -q{name}    Vim: Idem.
  743.  
  744. -R        Elvis, Nvi, Posix, Vim: Set the 'readonly' option.
  745.  
  746. -r        Elvis, Nvi, Posix, Vi, Vim, Vim: Recovery mode.
  747.  
  748. -S        Nvi: Set 'secure' option.
  749.  
  750. -s        Nvi, Posix, Vim: Same as "-" (silent mode), when in Ex mode.
  751.         Elvis: Sets the 'safer' option.
  752. -s {scriptin}    Vim: Read from script file {scriptin}; only when not in Ex
  753.         mode.
  754.  
  755. -t {tag}    Elvis, Nvi, Posix, Vi, Vim: Edit the file containing {tag}.
  756. -t{tag}        Vim: Idem.
  757.  
  758. -T {term}    Vim: Set terminal name to {term}.
  759.  
  760. -u {vimrc}    Vim: Read initializations from {vimrc} file.
  761.  
  762. -U {gvimrc}    Vim: Read GUI initializations from {gvimrc} file.
  763.  
  764. -v        Nvi, Posix, Vi, Vim: Begin in Normal mode (visual mode, in Vi
  765.         terms).
  766.  
  767. -V        Elvis, Vim: Verbose mode.
  768.  
  769. -w {size}    Elvis, Posix, Nvi, Vi, Vim: Set value of 'window' to {size}.
  770. -w{size}    Nvi, Vi: Same as "-w {size}".
  771. -w {name}    Vim: Write to script file {name} (must start with non-digit).
  772.  
  773. -W {name}    Vim: Append to script file {name}.
  774.  
  775. -x        Vi: Ask for encryption key.
  776.         Vim: Reserved for encryption key (not implemented yet).
  777.  
  778.  vim:ts=8:sw=8:tw=78:
  779.